<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<link rel="stylesheet"
		href="../resources/css/smoothness/jquery-ui-1.8.16.custom.css"
		type="text/css" />
	<script language="javascript" type="text/javascript"
		src="../resources/js/default.js"></script>
	<title>Chamada</title>
</h:head>

<h:body>


		<p:panelGrid columns="2" height="340" width="580">
		
			<f:facet name="header">Chamada </f:facet>
			<p:dataTable id="dataTable" value="#{matriculaBean.matriculas}"
				var="matricula">

				<p:column>
					<f:facet name="header"> Codigo Aluno </f:facet>
					<h:outputText value="#{matricula.aluno.id}" />
				</p:column>
				<p:column>
					<f:facet name="header"> Nome Aluno </f:facet>
					<h:outputText value="#{matricula.aluno.nome}" />
				</p:column>
				<p:column>
					<f:facet name="header"> Nome Disciplina </f:facet>
					<h:outputText value="#{matricula.turma.disciplina.nome}" />
				</p:column>
				<p:column>
					<f:facet name="header"> Nome Turma </f:facet>
					<h:outputText value="#{matricula.turma.descricao}" />
				</p:column>
				<p:column>
					<f:facet name="header"> Periodo </f:facet>
					<h:outputText value="#{matricula.turma.periodo}" />
				</p:column>
				<p:column>
							<f:facet name="header"> Percentual Presenca </f:facet>
							<h:outputText value="#{(100/matricula.turma.disciplina.cargaHoraria)*(matricula.turma.disciplina.cargaHoraria - matricula.faltas)} %"/>
						</p:column>
				<p:column>
					<f:facet name="header"> nota </f:facet>
					<h:inputText name="nota"></h:inputText>

				</p:column>
				<f:facet name="footer">  
            			
        			</f:facet>
    
        			<f:facet name="footer">
        				<p:toolbar>
        				<p:toolbarGroup align="right">
        				
        				<p:commandButton  value="Salvar" actionListener="" icon="ui-icon-check"/>
        				
        			
        				
        				</p:toolbarGroup>
        				<p:toolbarGroup align="left">
        				
        				Total #{fn:length(matriculaBean.matriculas)} Matriculas 
        				
        				</p:toolbarGroup>
        				
        				</p:toolbar>
									
					</f:facet>
			</p:dataTable>
		</p:panelGrid>

</h:body>

</html>